<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <meta
      name="description"
      content="汇融名企是面向全国商家服务的大型互联网平台，为商家提供流量扶持，引导品牌曝光；为消费者提供风云榜单，招商加盟，引导实现消费，达成合作，上汇融名企实现共赢。"
    />
    <link rel="stylesheet" href="./css/common.css" />
    <link rel="stylesheet" href="./css/JoininDetails.css" />
    <title>加盟详情-汇融名企</title>
  </head>
  <body>
    <!-- <div id="header-page"></div> -->
    <!--#include virtual="/header.html" -->
    <div class="joininDetail-top">
      <div class="wrapper" id="div-join-baseinfo"></div>
      <div class="wrapper">
        <div class="join-introduce-con inline-block">
          <div class="join-introduce">
            <ul class="join-introduce-tab">
              <li class="active" data-to="brand-display" id="brand-display">
                品牌展示
              </li>
              <li data-to="join-details">加盟详情</li>
              <li data-to="join-advantage">加盟优势</li>
            </ul>
            <div class="clear"></div>
            <div id="div-join-details"></div>
          </div>
          <div class="guess-like" id="div-guess-like"></div>
        </div>
        <div
          class="hot-recommended inline-block"
          id="div-hot-recommended"
        ></div>
        <div class="clear"></div>
      </div>
    </div>
    <!-- <div id="footer-page"></div>  -->
    <!--#include virtual="/footer.html" -->
    <script src="./js/jquery-1.11.0.min.js"></script>
    <script src="./js/jquery.tmpl.min.js"></script>
    <script src="./js/utils.js"></script>
    <script src="./js/api.js"></script>
    <script src="./js/jquery.my-message.1.1.js"></script>
    <script type="text/x-jquery-tmpl" id="join-baseinfo">
      <div class="joininDetail-baseInfo inline-block">
        <div class="join-baseinfo-img">
          <img src="${(img[0].indexOf('http'))>-1 ? img[0] : imgURL+img[0]}" alt="${title}"/>
        </div>
        <div class="base-text">
          <h1 class="need-text-overflow">${title}</h1>
          <div class="investment-amount">
            <img src="./image/icon/index_tzje_icon.png" alt="投资金额-汇融名企" />
            <span>投资金额：</span>
            <p><strong>${investment}</strong></p>
          </div>
          <ul>
            <li>
              <img src="./image/icon/index_tzje_icon.png" alt="经营范围-汇融名企" />
              <p class="inline-block need-text-overflow">经营范围：${main_ind}</p>
            </li>
            <li>
              <img src="./image/icon/index_sshy_icon.png" alt="所属行业-汇融名企" />
              <p class="inline-block need-text-overflow">所属行业：${industry}</p>
            </li>
            <li>
              <img src="./image/icon/index_clsj_icon.png" alt="成立时间-汇融名企" />
              <p class="inline-block need-text-overflow">成立时间：${found_year}</p>
            </li>
            <li>
              <img src="./image/icon/index_mdzss_icon.png" alt="门店总数-汇融名企" />
              <p class="inline-block need-text-overflow">门店总数：${store_total}</p>
            </li>
            <li>
              <img src="./image/icon/index_jmqy_icon.png" alt="加盟区域-汇融名企" />
              <p class="inline-block need-text-overflow">加盟区域：${join_region}</p>
            </li>
            <li>
              <img src="./image/icon/index_shrq_icon.png" alt="适合人群-汇融名企" />
              <p class="inline-block need-text-overflow">适合人群：自由创业者</p>
            </li>
          </ul>
          <div class="clear"></div>
          <div class="business-profile">
            <p>
              <span>
                商家简介：
              </span>
              <i id="businessProfile"></i>
            </p>
          </div>
        </div>
      </div>
      <div class="joininDetail-logo inline-block right">
        <div class="join-logo-img">
          <img src="${(logo.indexOf('http'))>-1 ? logo : imgURL+logo}" alt="${title}" />
        </div>
        <h1 class="need-text-overflow">${company_name}</h1>
        <ul>
          <li>
            <img src="./image/icon/index_qyxz_icon.png" alt="企业性质-汇融名企" />
            <p class="inline-block need-text-overflow">企业性质：${nature}</p>
          </li>
          <li>
            <img src="./image/icon/index_zczj_icon.png" alt="注册资金-汇融名企" />
            <p class="inline-block need-text-overflow">注册资金：${capital}</p>
          </li>
          <!-- <li>
            <img src="./image/icon/index_fxd_icon.png"/>
            <p class="inline-block">分享到：
              <img src="./image/icon/index_fxwb_icon.png" alt="分享-汇融名企" />
              <img src="./image/icon/index_fxwx_icon.png" alt="分享-汇融名企" />
            </p>
          </li> -->
        </ul>
        <!-- <img src="./image/picture/index_zhmqgg_img.png" alt="汇融名企" /> -->
      </div>
      <div class="clear"></div>
    </script>
    <script type="text/x-jquery-tmpl" id="join-details">

      <div class="join-introduce-picture" id="brand-display">
        {{each img}}
        <div class="join-introduce-img">
          <image src="{{= ($value.indexOf('http'))>-1?$value:imgURL+$value}}">
        </div>
        {{/each}}
      </div>
      <div class="franchise-details" id="join-details">
        <h1>加盟详情：</h1>
        <p id="detailsText">
          </p>
      </div>
      <div class="joining-advantages" id="join-advantage">
          <h1>加盟优势：</h1>
          <p id="advantageText">
          </p>
      </div>
    </script>
    <script type="text/x-jquery-tmpl" id="guess-like">
      <div class="title">
        <div style="position: relative">
          <img src="./image/picture/index_cnxhbt_img.png" alt="猜你喜欢-汇融名企" />
          <a href="merchantsJoinList.html" class="title-more">MORE <span>></span></a>
        </div>
        <div class="title-divider-wrapper">
          <div class="title-divider-colorbar"></div>
          <div class="title-divider"></div>
        </div>
      </div>
      <div class="guess-like-con">
        {{each guessBrand}}
        <div class="related-brand-box">
          <div class="related-brand-con" id="{{= $value.id}}">
            <image src="{{= ($value.img.indexOf('http'))>-1?$value.img:imgURL+$value.img}}" alt="{{= $value.title}}" />
            <p class="need-text-overflow">{{= $value.title}}</p>
          </div>
        </div>
        {{/each}}
      </div>
    </script>
    <script type="text/x-jquery-tmpl" id="hot-recommended">
      <div class="related-brand">
        <h1 class="inline-block">相关品牌</h1>
        {{each relevantBrand}}
        <div class="related-brand-con" id="{{= $value.id}}">
          <image src="{{= ($value.img.indexOf('http'))>-1?$value.img:imgURL+$value.img}}" alt="{{= $value.title}}" />
            <p class="need-text-overflow">{{= $value.title}}</p>
        </div>
        {{/each}}
      </div>
      <div class="related-brand" style="margin-top:38px">
        <h1 class="inline-block">热门加盟</h1>
        {{each popularBrand}}
        <div class="related-brand-con" id="{{= $value.id}}">
          <image src="{{= ($value.img.indexOf('http'))>-1?$value.img:imgURL+$value.img}}" alt="{{= $value.title}}" />
            <p class="need-text-overflow">{{= $value.title}}</p>
        </div>
        {{/each}}
      </div>
    </script>

    <script type="text/javascript">
      $(function () {
        var params = {
          id: window.location.href.split('id=')[1],
        }
        var api = new ajax('GET', '/api/merchant/view', params)
        api.then(function (res) {
          init(JSON.parse(res).data)
        })
      })
      function init(data) {
        // $('#header-page').load('header.html')
        // $('#footer-page').load('footer.html')
        document.title = data.merchantOne.title + '-汇融名企'
        $('#join-baseinfo')
          .tmpl(data.merchantOne)
          .appendTo('#div-join-baseinfo')
        $('#join-details').tmpl(data.merchantOne).appendTo('#div-join-details')
        $('#detailsText').html(data.merchantOne.JMxiangqing)
        $('#advantageText').html(data.merchantOne.JMyoushi)
        $('#businessProfile').text($('#detailsText').text().substring(0, 100))
        $('#guess-like').tmpl(data).appendTo('#div-guess-like')
        $('#hot-recommended').tmpl(data).appendTo('#div-hot-recommended')
      }
      $('#div-guess-like').delegate('.related-brand-con', 'click', function (
        e
      ) {
        go('JoininDetails.html?id=' + e.currentTarget.id)
      })
      $('#div-hot-recommended').delegate(
        '.related-brand-con',
        'click',
        function (e) {
          go('JoininDetails.html?id=' + e.currentTarget.id)
        }
      )
      // $('#div-guess-like').delegate('.title-more', 'click', function (e) {
      //   go('merchantsJoinList.html')
      // })
      $('.join-introduce-tab').on('click', 'li', function (e) {
        $('.join-introduce-tab').find('li').removeClass('active')
        $(this).addClass('active')
        var target = e.target
        var id = $(target).data('to')
        $('html,body').animate(
          { scrollTop: $('#' + id).offset().top - 30 },
          800
        )
      })
      $(document).on('mousewheel DOMMouseScroll', function (e) {
        if ($(window).scrollTop() < $('#brand-display').offset().top + 100) {
          $('.join-introduce-tab').find('li').removeClass('active')
          $('#brand-display').addClass('active')
        }
      })
    </script>
  </body>
</html>
